//
// Created by admin on 2024/8/10.
// 埃氏筛法

#include <iostream>

using namespace std;

int main()
{
    int n=100; //25
    n=1000;//168
    n=10000;//1229
    n=100000;//9592
//    cin >> n;
    bool l[n + 1]={0};
    for (int i = 2; i <=n ; ++i)
    {
        l[i]=1;
    }
    for (int i = 2; i*i <= n ; ++i)
    {
        if(l[i])
        {
        for (int j = i+i; j <=n ; j+=i)
//            for (int j = 1; j*i <=n ; j++)
            {
                l[j]=0;
            }

        }
    }
    int ret=0;
    for (int i = 2; i <=n ; ++i)
    {
        if (l[i])
            ret++;
    }
    cout<<ret;
    return 0;
}